package com.yadang.infra.service;

import cn.hutool.core.bean.BeanUtil;
import com.yadang.infra.bean.StaffInfo;
import com.yadang.infra.bean.dto.CodeToNameDto;
import com.yadang.infra.mapper.StaffInfoMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;

import java.util.LinkedList;
import java.util.List;

@Service
public class StaffInfoService {
    @Autowired
    private StaffInfoMapper staffInfoMapper;

    public List<CodeToNameDto> selectAll() {
        List<StaffInfo> staffInfos = staffInfoMapper.selectAll();
        List<CodeToNameDto> codeToNameDtos = BeanUtil.copyToList(staffInfos, CodeToNameDto.class);
        return codeToNameDtos;
    }
}
